<template>
  <div id="layout_app">
    <el-container>
      <el-aside width="200px">
        <h1><img class="logopc" src="../assets/logo-white.png" alt="" /></h1>
        <el-menu
          class="el-menu-vertical-demo"
          background-color="#ff5a3b"
          text-color="#fff"
          active-text-color="#fff"
        >
          <el-menu-item index="1">
            <i class="el-icon-s-home" style="color: white"></i>
            <span slot="title">首页</span>
          </el-menu-item>

          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-setting" style="color: white"></i>
              <span> 系统设置</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="2-1">菜单管理</el-menu-item>
              <el-menu-item index="2-2">角色管理</el-menu-item>
              <el-menu-item index="2-3">管理人员管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-goods" style="color: white"></i>
              <span>商城管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="3-1">分类管理</el-menu-item>
              <el-menu-item index="3-2">规格管理</el-menu-item>
              <el-menu-item index="3-3">商品管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header>
          <div class="login-info">
            <img src="../assets/logo.png" alt="" class="login-info_img" />
            <el-dropdown>
              <span class="el-dropdown-link">
                个人中心<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>个人中心 </el-dropdown-item>
                <el-dropdown-item>系统设置</el-dropdown-item>
                <el-dropdown-item>设置中心 </el-dropdown-item>
                <el-dropdown-item >
                 <span @click="outform">安全退出</span> 
                  </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </el-header>
        <el-main>
          <router-view> </router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  methods:{
    outform(){
      localStorage.removeItem('loginData')
      this.$router.replace('/login')
      this.$message({
            type:"success",
            message:'退出成功，再见！',
        });
    }
  }
};
</script>

<style>
.el-header {
  background-color: #fff;
  color: #333;

  line-height: 60px;
}
.login-info {
  width: 200px;
  float: right;
  line-height: 60px;
}
.login-info_img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  vertical-align: middle;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}

.el-aside {
  background-color: #ff5a3b;
  color: #fff;
  height: 100vh;
}

.el-aside h1 {
  width: 100%;
  text-align: center;
  margin-top: 10px;
  margin-bottom: 10px;
}
.el-aside h1 img {
  width: 140px;
}
.el-submenu__title i {
  color: white;
}
.el-main {
  background-color: #e9eef3;
  color: #333;

  line-height: 160px;
}
</style>